import request from '@/utils/request'

// 创建设备
export function createEquipment(data) {
  return request({
    url: '/zy/equipment/create',
    method: 'post',
    data: data
  })
}

// 更新设备
export function updateEquipment(data) {
  return request({
    url: '/zy/equipment/update',
    method: 'put',
    data: data
  })
}

// 删除设备
export function deleteEquipment(id) {
  return request({
    url: '/zy/equipment/delete?id=' + id,
    method: 'delete'
  })
}

// 获得设备
export function getEquipment(id) {
  return request({
    url: '/zy/equipment/get?id=' + id,
    method: 'get'
  })
}

// 获得设备分页
export function getEquipmentPage(params) {
  return request({
    url: '/zy/equipment/page',
    method: 'get',
    params
  })
}
// 导出设备 Excel
export function exportEquipmentExcel(params) {
  return request({
    url: '/zy/equipment/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}